import { FormProps, BasicColumn } from '@/components/Table';

//查询条件，Partial：将FormProps所有属性转为可选
export const formConfig: Partial<FormProps> = {
  labelWidth: 100,
  schemas: [
    {
      field: `account`,
      label: `用户名`,
      component: 'Input',
      colProps: {
        xl: 12,
        xxl: 8,
      },
    },
  ],
};

//表格
export const columns: BasicColumn[] = [
  {
    title: '用户名',
    dataIndex: 'account',
    width: 120,
  },
  {
    title: '邮箱',
    dataIndex: 'email',
    width: 120,
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
    width: 180,
  },
  {
    title: '备注',
    dataIndex: 'remark',
  },
];

//获取数据（假数据）
export function getBasicData() {
  return (() => {
    const arr: any = [];
    for (let index = 0; index < 40; index++) {
      arr.push({
        id: `${index}`,
        account: 'John Brown',
        email: `1${index}@qq.com`,
        createTime: new Date().toLocaleString(),
        remark: '假数据',
      });
    }
    return arr;
  })();
}
